import Vue from 'vue'
import VueRouter from 'vue-router'
Vue.use(VueRouter);

    const routes = [
    // 设置路由配置
        {
            // 设置URL
            path: '/',
            // 设置对应组件
            component: () => import('../components/common/Home.vue'),
            // 设置相应元信息
            meta: {
                requireAuth: true
            },
            children: [
                {
                    path: '/info',
                    component: () => import('../components/page/Info.vue')
                },
                {
                    path: '/leave_list',
                    component: () => import('../components/page/LeaveList.vue')
                },
                {
                    path: '/leave_examination',
                    component: () => import('../components/page/LeaveExamination.vue')
                },
                {
                    path: '/leave_post',
                    component: () => import('../components/page/LeavePost.vue')
                },
                {
                    path: 'approval_list',
                    component: () => import('../components/page/ApprovalRecord.vue')
                },
                {
                    path: '/attendance',
                    component: () => import('../components/page/Attendance.vue')
                }
            ]
        },
        {
            path: '/login',
            component: () => import('../components/page/Login.vue')
        }
    ]
export default new VueRouter ({
    routes
})